home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / owlspl2.zip / SPLMAIN.CPP < prev    next >
C/C++ Source or Header  |  1992-07-20  |  1KB  |  80 lines

  1. #include "splasher.hpp"
  2. #pragma hdrstop
  3. #include "splmain.hpp"
  4.  
  5. TSplashWin::TSplashWin( PTWindowsObject AParent, int ResourceId )
  6.               : TDialog( AParent, ResourceId )
  7.     {
  8.     InitControls();
  9.     }
  10.  
  11.  
  12. void TSplashWin::InitControls()
  13.     {
  14.     }
  15.  
  16.  
  17. void TSplashWin::SetupWindow()
  18.     {
  19.     TDialog::SetupWindow();
  20.     PostMessage( HWindow, WM_COMMAND, CM_DISPLAY_SPLASH, 0L );
  21.      }
  22.  
  23.  
  24. LPSTR TSplashWin::GetClassName()
  25.     {
  26.     return "bordlg_01";
  27.     }
  28.  
  29.  
  30. void TSplashWin::GetWindowClass( WNDCLASS& WndClass )
  31.     {
  32.     TDialog::GetWindowClass( WndClass );
  33.     WndClass.lpfnWndProc = BWCCDefDlgProc;
  34.     WndClass.hIcon = LoadIcon( GetApplication()->hInstance,
  35.                                         MAKEINTRESOURCE( Splash ) );
  36.     }
  37.  
  38.  
  39. void TSplashWin::CMDisplaySplash( void )
  40.     {
  41.     SplashWin = GetApplication()->MakeWindow( new TDialog( this, ID_ABOUT ) );
  42.     DisplaySplash = TRUE;
  43.     SetTimer( HWindow, ID_SPLASH_TIMER, 3000, NULL );
  44.     }
  45.  
  46.  
  47. void TSplashWin::WMTimer( RTMessage Msg )
  48.     {
  49.     if ( DisplaySplash && Msg.WParam == ID_SPLASH_TIMER )
  50.         {
  51.       DisplaySplash = FALSE;
  52.         SplashWin->CloseWindow();
  53.       }
  54.     }
  55.  
  56.  
  57. void TSplashWin::CMMainExit( RTMessage )
  58.     {
  59.     CloseWindow();
  60.     }
  61.  
  62.  
  63. BOOL TSplashWin::CanClose()
  64.     {
  65.     return ( BWCCMessageBox( HWindow, "End program now?",
  66.                 "Please verify", MB_YESNO ) == IDYES );
  67.     }
  68.  
  69.  
  70. void TSplashWin::CMExit( RTMessage )
  71.     {
  72.     CloseWindow();
  73.     }
  74.  
  75.  
  76. void TSplashWin::CMHelpAbout( RTMessage )
  77.     {
  78.     GetApplication()->ExecDialog( new TDialog( this, ID_ABOUT ) );
  79.     }
  80.